package com.hwh.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.hwh.serviceIm.BuyersServiceImpl;
import com.hwh.serviceIm.SellersServiceImpl;
import com.hwh.vo.Buyers;
import com.hwh.vo.Sellers;

public class SellerRegistController extends HttpServlet{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) 
	         throws ServletException, IOException {
       super.doPost(req, resp);
   }

	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		
		req.setCharacterEncoding("utf-8");
		// 获取前台form表单的input输入框
		String sell_name = req.getParameter("sell_name");
		String sell_pwd = req.getParameter("sell_pwd");
		int sell_phone = Integer.parseInt(req.getParameter("sell_phone"));
		Sellers seller = new Sellers(sell_name,sell_pwd,sell_phone);
		
		SellersServiceImpl bsi = new SellersServiceImpl();
		bsi.sellerRegist(seller);
		
		req.getRequestDispatcher("sellogin.jsp").forward(req, resp);
		
		
		
	}
	
	
	
}
